<script setup>
import {pageofficeOpenFile} from "@/plugins/pageoffice/pageoffice-common.js";
import {backProcessDocList} from "@/utils/backList.js";
import AdviceList from "@/views/document/common/advice/adviceList.vue";

const prop = defineProps({
  docId: {
    type: Number
  },
  isOpenFinalPdf: {
    type: Boolean
  },
  isRefreshAdvice: {
    type: Boolean
  }
})

function openApprovalFile() {
  pageofficeOpenFile('/document/processed/openApprovalFile/' + prop.docId, prop.docId)
}

function openMainFile() {
  pageofficeOpenFile('/document/processed/openMainFile/' + prop.docId, prop.docId)
}

function openFinalFile() {
  pageofficeOpenFile('/document/processed/openFinalFile/' + prop.docId, prop.docId)
}
</script>

<template>
  <el-row>
    <el-col :span="12" class="left">
      <el-row>
        <el-form-item>
          <el-button @click="backProcessDocList">返 回</el-button>
          <el-button type="primary" @click="openApprovalFile" v-if="!isOpenFinalPdf">打开呈批表</el-button>
          <el-button type="primary" @click="openMainFile" v-if="!isOpenFinalPdf">打开正文</el-button>
          <el-button type="primary" @click="openFinalFile" v-if="isOpenFinalPdf">打开正文</el-button>
        </el-form-item>
      </el-row>
    </el-col>
  </el-row>

  <!-- 意见列表 -->
  <AdviceList :isRefreshAdvice="isRefreshAdvice"/>
</template>

